var util = require('../../utils/util.js');
var ajax = require('../../utils/ajax.js');
var common = require('../../utils/common.js');
var PageBase = require('../../common/PageBase.js');
var app = getApp();

Page(common.extendPage(PageBase, {
    data: {
        winHei: 0,
        submiting: false,
        logoImg:''
    },

    onLoad() {
        this.setData({
            logoImg:app.getLogoImg()
        })
    },

    onShow() {},
    /**
     * 登录
     */
    _submit: function(evt) {


        var {
            account,
            password
        } = evt.detail.value;

        // var account = 15068888888;
        // var password = '000000';


        var url = "/market/Login/employeeIn";
        var data = {
            account,
            password
        }

        this.setData({
            submiting: true
        })

        ajax.P({
            url,
            data,
            success: (data) => {
                var employee_sid = data.result.employee_sid;
                app.setEmployeeSid(employee_sid);
                wx.redirectTo({
                    url: '/pages/featureList/index'
                })
                this.setData({
                    submiting: false
                })
            },
            fail: (data) => {
                this.setData({
                    submiting: false
                })
            }
        })
    }
}));